package com.hpeu_01.day0115.homework;

import java.lang.annotation.*;

@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@interface MyTiger {
    String value() default "hpeu";
}
@MyTiger(value = "慧与")
public class Person {
    private String name;

    public Person(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                '}';
    }

    public static void main(String[] args) {
        Class clazz = Person.class;
        Annotation a = clazz.getAnnotation(MyTiger.class);
        MyTiger m = (MyTiger) a;
        String info = m.value();
        System.out.println(info);
//        MyTiger anno = Person.class.getAnnotation(MyTiger.class);
//        System.out.println(anno.value());
    }
}
